<template>
  <div class="user">
    <div class="my">我的</div>
    <div class="massage" @click="userClick">
      <div class="set">
        <div class="img">
          <img src="../../img/2211.jpg" >
        </div>
        <div>
          <span>小撩宝宝</span>
          <p>手机号：{{this.phone}}</p>
        </div>
      </div>
      <van-icon name="arrow" />
    </div>


    <van-cell is-link value="查看全部订单" @click="handleClick">
      <div slot="title" class="item">
        <van-icon name="smile-comment" color="orangered" size="22px"/>
        <span>我的订单</span>
      </div>
    </van-cell>


    <!-- 导航列表 -->
    <div class="navList">
      <van-grid>
        <van-grid-item icon="cart-circle-o" text="待支付" />
        <van-grid-item icon="gift-o" text="待收货" />
        <van-grid-item icon="smile-comment-o" text="待付款" />
        <van-grid-item icon="cash-back-record" text="售后/退款" />
      </van-grid>
    </div>

    <div class="items">
      <van-cell is-link value="1张">
        <div slot="title" class="item">
          <van-icon name="gold-coin" color="orangered" size="22px"/>
          <span>我的优惠券</span>
        </div>
      </van-cell>
      <van-cell is-link>
        <div slot="title" class="item">
          <van-icon name="todo-list" color="orangered" size="22px"/>
          <span>我的收获地址</span>
        </div>
      </van-cell>
    </div>

    <div class="items">
      <van-cell is-link value="客服时间 07:00-22:00">
        <div slot="title" class="item">
          <van-icon name="phone" color="orangered" size="22px"/>
          <span>联系客服</span>
        </div>
      </van-cell>
      <van-cell is-link>
        <div slot="title" class="item">
          <van-icon name="smile-comment" color="orangered" size="22px"/>
          <span>意见反馈</span>
        </div>
      </van-cell>
    </div>

    <van-cell is-link value="下载APP体验更佳">
      <div slot="title" class="item">
        <van-icon name="gift-card" color="orangered" size="22px"/>
        <span>小撩买菜</span>
      </div>
    </van-cell>
  </div>
</template>

<script>
  import { mapGetters } from 'vuex'
  export default {
    name: 'User',
    data() {
      return {
        phone:0,
      }
    },
    computed: {
      ...mapGetters([
            'getUserInfo',
          ])
    },
    methods:{
      handleClick() {
        this.$router.push('/myorder')
      },
      userClick() {
        this.$router.push('/home/user/usercenter')
      }
    },
    mounted() {
      this.phone = this.$store.getters.getUserInfo.phone
    }
  }
</script>

<style scoped>
  .my{
    width: 100%;
    line-height: 90px;
    text-align: center;
    font-size: 34px;
    color: #FFFFFF;
    background-color: #3bba63;
  }

  .massage{
    width: 100%;
    background-color: #3bba63;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #FFFFFF;
    font-size: 28px;
    padding: 0 32px;
    box-sizing: border-box;
  }
  .set{
    display: flex;
    align-items: center;
  }
  .massage .img{
    width: 150px;
    height: 150px;
    border: 2px solid #FFFFFF;
    border-radius: 50%;
    margin: 20px 20px 20px 0;
    overflow: hidden;
  }
  .massage .img img{
    width: 150px;
    height: 150px;
  }
  /* 我的订单 */

  .item{
    display: flex;
    align-items: center;
  }
  .item span{
    margin-left: 8px;
  }

  .items{
    margin: 15px 0;
  }
</style>
